import unittest
from test_mathfunc import TestMathFunc

if __name__ == '__main__':
    suite = unittest.TestSuite()

    # 用addTests + TestLoader
    # loadTestsFromName()，传入'模块名.TestCase名',以下方法二选一

    #suite.addTests(unittest.TestLoader().loadTestsFromName('test_mathfunc.TestMathFunc'))
    suite.addTests(
        unittest.TestLoader().loadTestsFromNames(['test_mathfunc.TestMathFunc']))  # loadTestsFromNames()，类似，传入列表

    runner = unittest.TextTestRunner(verbosity=2)
    runner.run(suite)
